#ifndef DEF_LANDSCAPE
#define DEF_LANDSCAPE

#include <iostream>
#include <vector>

#include "../Models/GameObject.h"

class Landscape : public GameObject
{
public :
	Landscape();
	Landscape(std::string name);
	~Landscape();


	void SetParameters(int nbVertexX, int nbVertexY, float sizeX, float sizeY, float smoothness);
	void GenerateLandscape();
	//virtual void Update(float time);

private: 
	void SetVertexAndFaces();
	void Diamond(int depth, float smoothness);
	void Square(int depth, float smoothness);
	float ComputeAveragePosition(int leftUp, int rightUp, int rightDown, int leftDown);
	bool IsVertexOnRange(int index);

private:
	int _nbVertexX;
	int _nbVertexY;
	float _sizeX;
	float _sizeY;
	float _smoothness;
	float _minHeight;
	float _maxHeight;
	float* _vertex;
	int _nbVertex;
	short* _index;
};


#endif